
// 获取所有可参与的旅游活动信息
exports.getActivitiesList = async (scenic_id, category, page = 1, limit = 10) => {
  // 模拟数据
  const activities = [
    { id: 1, scenic_id: 1, activity_name: '周家庄民俗体验', activity_type: '文化体验', price: 100, description: '体验周家庄传统民俗文化，包括制作手工艺品等。', start_time: '2025-02-01 09:00', end_time: '2025-02-01 11:00', location: '周家庄村文化馆', image: 'https://example.com/image1.jpg' },
    { id: 2, scenic_id: 1, activity_name: '周家庄民俗文化体验', activity_type: '文化体验', price: 120, description: '深入了解周家庄的传统民俗，亲自参与手工艺品制作。', start_time: '2025-02-01 10:00', end_time: '2025-02-01 12:00', location: '周家庄村文化馆', image: 'https://example.com/image2.jpg' },
  ];
  return {
    total: activities.length,
    page,
    list: activities.slice((page - 1) * limit, page * limit),
  };
};

// 获取单个旅游活动的详细信息
exports.getActivityById = async (id) => {
  // 模拟数据
  const activities = [
    { id: 1, scenic_id: 1, activity_name: '周家庄民俗体验', activity_type: '文化体验', price: 100, description: '体验周家庄传统民俗文化，包括制作手工艺品等。', start_time: '2025-02-01 09:00', end_time: '2025-02-01 11:00', location: '周家庄村文化馆', max_participants: 20, current_participants: 12, image: 'https://example.com/image1.jpg' },
    { id: 2, scenic_id: 1, activity_name: '周家庄民俗文化体验', activity_type: '文化体验', price: 120, description: '深入了解周家庄的传统民俗，亲自参与手工艺品制作。', start_time: '2025-02-01 10:00', end_time: '2025-02-01 12:00', location: '周家庄村文化馆', max_participants: 30, current_participants: 15, image: 'https://example.com/image2.jpg' },
  ];
  return activities.find(activity => activity.id === parseInt(id));
};

// 创建一个新的旅游活动
exports.createActivity = async (activityData) => {
  // 模拟数据
  const activity = {
    id: Date.now(),
    ...activityData,
  };
  return activity;
};

// 用户报名参加某个活动
exports.signupForActivity = async (signupData) => {
  // 模拟数据
  const signup = {
    signup_id: Date.now(),
    ...signupData,
  };
  return signup;
};

// 查询用户报名的所有活动记录
exports.getUserSignups = async (user_id) => {
  // 模拟数据
  const signups = [
    { signup_id: 12345, activity_id: 1, activity_name: '周家庄民俗体验', activity_type: '文化体验', price: 100, participants: 2, contact_name: '张三', contact_phone: '13800138000', status: '已报名', start_time: '2025-02-01 09:00' },
    { signup_id: 12346, activity_id: 2, activity_name: '周家庄民俗文化体验', activity_type: '文化体验', price: 120, participants: 1, contact_name: '李四', contact_phone: '13800138001', status: '已报名', start_time: '2025-02-01 10:00' },
  ];
  return signups.filter(signup => signup.user_id === parseInt(user_id));
};

// 用户取消已报名的活动
exports.cancelSignup = async (signup_id, user_id) => {
  // 模拟数据
  return { signup_id, user_id, status: '取消报名成功' };
};

// 管理员修改已发布的活动信息
exports.updateActivity = async (id, activityData) => {
  // 模拟数据
  return { id, ...activityData, message: '活动更新成功' };
};
